/*
 * Created on 2006-02-15
 */
package dk.aiszone.lang.comparatorfactory;

import junit.framework.TestCase;

/**
 * Test cases testing the output of the Comparator factory.
 * 
 * @author <a href="mailto:ais@mail.dk">Ais</a>
 */
public class ComparatorFactoryTest extends TestCase {

    /**
     * Tests the output of the comparator factory.
     */
    public void testComparatorFactoryGeneratedFile() {
        try {
            generatorTest("Test1.xml", "TestCF1.java");
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception not expected");
        }
    }

    private void generatorTest(String xml, String java) throws Exception {

    // SAXBuilder builder = new SAXBuilder(false);
    //
    // Document document = builder.build(AiszoneLangAllTests.SOURCE_DIR + "/comparatorfactory/" + xml);
    // Element root = document.getRootElement();
    //
    // ComparatorFactory cf = new ComparatorFactory(root);
    //
    // String toString = cf.dumpToString();
    //
    // AiszoneLangTestHelper.assertFileContentsWithString(AiszoneLangAllTests.SOURCE_DIR + "/comparatorfactory/" + java, toString);
    //
    // java.lang.Class<Comparator<?>> _class = cf.compileClass();
    //
    // Constructor<Comparator<?>> constructor = _class.getConstructor(new Class[] { ComparatorObjectProvider.class });
    //
    // Comparator<?> object = constructor.newInstance(new Object[] { null });
    }
}